package com.tzxs.pay.main.gt.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.tzxs.pay.main.gt.GtInterface;

import java.util.Objects;

//个推接收消息后更新ui广播
public class GtReceiver extends BroadcastReceiver {
    public static final String action = "com.tzxs.pay.main.gt.broadcast.GtReceiver";
    private GtInterface gtInterface;

    //接收到广播后更新ui
    @Override
    public void onReceive(Context context, Intent intent) {

        if (Objects.equals(intent.getAction(), action)) {
            gtInterface = (GtInterface) context;
            //发送内容
            if (intent.getStringExtra("content") != null)
                gtInterface.updateUi(intent.getStringExtra("content"));
        }
    }
}
